# 无 token 验证.

import hashlib
from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route("/bili", methods=["POST"])
def bili_sign():
    """
    request data form {"ordered_string"}
    """
    try:
        ordered_string = request.json.get("ordered_string")
        if not ordered_string:
            return jsonify({"status":False,"data":"参数错误"})

        encrypt_string = ordered_string + "560c52ccd288fed045859ed18bffd9773"
        obj = hashlib.md5(encrypt_string.encode("utf-8"))
        sign = obj.hexdigest()
        return jsonify({"status": True, "data": sign})
    except:
        return jsonify({"status": False, "data": "未知错误"})


if __name__ == "__main__":
    app.run()
